package com.beiji.lib.pen.constants

import android.graphics.Color

/**
 * 笔迹调色板常量
 * Created by X on 2018/7/7.
 */
enum class PaletteMarkColor(val id: Int, val value: String) {
    COLOR_0(0, "#13151515"),
    COLOR_1(1, "#13C739DC"),
    COLOR_2(2, "#13137EFB"),
    COLOR_3(3, "#130BD0E9"),
    COLOR_4(4, "#1353D769"),
    COLOR_5(5, "#13FED02F"),
    COLOR_6(6, "#13FF8F21"),
    COLOR_7(7, "#13FC3042");

    fun toColor(): Int {
        return Color.parseColor(value)
    }

    companion object {
        fun fromId(id: Int): PaletteMarkColor {
            PaletteMarkColor.values().forEach {
                if (id == it.id) {
                    return it
                }
            }
            return COLOR_0
        }
    }

}